<?php

declare(strict_types=1);

use App\Lib\Mongo\MongoDbConnection;
/**
 * mongo数据库的配置
 */

return [
    'default' => [
            'driver' => MongoDbConnection::class,
             'username' => env('MONGO_USERNAME', 'root'),
             'password' => env('MONGO_PASSWORD', ''),
             'host' => env('MONGO_HOST', 'localhost'),
             'port' => env('MONGO_PORT', 27017),
             'db' => env('MONGO_DATABASE', 'test'),
             'prefix' => env('MONGO_PREFIX', 'pc_'),
             //设置复制集,没有不设置
             //'replica' => 'rs0',
            'pool' => [
                'min_connections' => 3,
                'max_connections' => 30,
                'connect_timeout' => 10.0,
                'wait_timeout' => 3.0,
                'heartbeat' => -1,
                'max_idle_time' => (float) env('MONGODB_MAX_IDLE_TIME', 60),
            ],
    ],
];

